GeT Cameras - Lens Controller
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | List of all members
api.LensControllerAPI Class Reference

This class provides the LensControllerAPI, a class for interfacing with the GeTCameras lens controller over a serial port. More...

Public Member Functions

 __init__ (self, port)
 initializes the LensControllerAPI class.
 
 connect (self)
 Opens the serial connection to the lens controller.
 
 disconnect (self)
 Closes the serial connection to the lens controller.
 
 send_command (self, command)
 Sends a command to the lens controller and reads the response.
 
 send_custom_command_and_receive (self, command1, data1=0x01, data2=0x02, data3=0x03, data4=0x04)
 Sends a custom command to the lens controller and reads the response.
 
 pelco_d_zoom_in (self)
 Send Pelco D Command - Zoom in.
 
 pelco_d_zoom_out (self)
 Send Pelco D Command - Zoom out.
 
 pelco_d_focus_far (self)
 Send Pelco D Command - Focus far.
 
 pelco_d_focus_near (self)
 Send Pelco D Command - Focus near.
 
 pelco_d_iris_open (self)
 Send Pelco D Command - Iris open.
 
 pelco_d_iris_close (self)
 Send Pelco D Command - Iris close.
 
 pelco_d_stop_all (self)
 Send Pelco D Command - Stop all focus, iris and zoom actions.
 
 pelco_d_call_preset (self, preset)
 Send Pelco D Command - Call preset.
 
 pelco_d_set_preset (self, preset)
 Send Pelco D Command - Set preset; Set current positions under preset# @Note: The preset is set, but will be lost after power cycle.
 
 pelco_d_set_zoom_speed (self, speed)
 Send Pelco D Command - Set zoom speed; Set speed for zooming in and out @Note: Call custom_store_current_settings() to store the set speed in the lens controller.
 
 pelco_d_set_focus_speed (self, speed)
 Send Pelco D Command - Set focus speed; Set speed for focussing far and near @Note: Call custom_store_current_settings() to store the set speed in the lens controller.
 
 custom_calibrate_all (self)
 Send Custom Command - Calibrate the lens controller.
 
 custom_select_lens_default_afz (self)
 Send Custom Command - Select lens type: GeTCameras AFZ Lens.
 
 custom_select_lens_S1MZ1040_D_P_M_IR_12M (self)
 Send Custom Command - Select lens type: GeTCameras S1MZ1040_D_P_M_IR_12M Lens.
 
 custom_get_zoom_position (self)
 Send Custom Command - Get zoom position This function retrieves the current zoom position of the lens.
 
 custom_set_zoom_position (self, zoom_position)
 Send Custom Command - Set zoom position of the lens.
 
 custom_get_focus_position (self)
 Send Custom Command - Get focus position This function retrieves the current focus position of the lens.
 
 custom_set_focus_position (self, focus_position)
 Send Custom Command - Set focus position of the lens.
 
 custom_get_iris_position (self)
 Send Custom Command - Get iris position This function retrieves the current focus position of the lens.
 
 custom_set_iris_position (self, iris_position)
 Send Custom Command - Set iris position of the lens.
 
 custom_get_lens_type (self)
 Send Custom Command - Get lens type This function retrieves the selected lens type.
 
 custom_store_current_settings (self)
 Send Custom Command - store current settings in lens controller This function stores all settings in the lens controller.
 
 custom_disable_stall_detection (self)
 Send Custom Command - Disable stall detection for all motors This function disables stall detection for all motors.
 
 custom_get_sensitivity_mode (self)
 Send Custom Command - Get sensitivity type This function retrieves the sensitivity mode.
 
 custom_set_sensitivity_mode (self, mode)
 Send Custom Command - Set sensitivity of the lens.
 

Public Attributes

 port
 
 connection
 

Static Public Attributes

 logger = logging.getLogger('logger')
 

Protected Member Functions

 _build_pelco_d_command (self, command1, command2, data1=0x00, data2=0x00)
 
 _build_custom_command (self, command1, data1=0x00, data2=0x00, data3=0x00, data4=0x00)
 

Detailed Description

This class provides the LensControllerAPI, a class for interfacing with the GeTCameras lens controller over a serial port.

The LensControllerAPI uses the Pelco-D and custom commands to control lens actions such as zooming, focusing, iris control, etc.

Constructor & Destructor Documentation

◆ __init__()

api.LensControllerAPI.__init__ (   self,
  port 
)

initializes the LensControllerAPI class.

Parameters
[in]portThe port to use for the serial connection.

Member Function Documentation

◆ custom_calibrate_all()

api.LensControllerAPI.custom_calibrate_all (   self)

Send Custom Command - Calibrate the lens controller.

This is automatically done on power on. @Note: The calibration process is not te be interrupted by other commands.

◆ custom_disable_stall_detection()

api.LensControllerAPI.custom_disable_stall_detection (   self)

Send Custom Command - Disable stall detection for all motors This function disables stall detection for all motors.

It serves as a solution in case motors have more resistance than expected.

◆ custom_get_focus_position()

api.LensControllerAPI.custom_get_focus_position (   self)

Send Custom Command - Get focus position This function retrieves the current focus position of the lens.

Returns
focus position as an integer.

◆ custom_get_iris_position()

api.LensControllerAPI.custom_get_iris_position (   self)

Send Custom Command - Get iris position This function retrieves the current focus position of the lens.

Returns
focus position as an integer.

◆ custom_get_lens_type()

api.LensControllerAPI.custom_get_lens_type (   self)

Send Custom Command - Get lens type This function retrieves the selected lens type.

Returns
lens type as an integer:
  • 0: None
  • 1: GeTCameras AFZ Lens
  • 2: GeTCameras S1MZ1040_D_P_M_IR_12M Lens

◆ custom_get_sensitivity_mode()

api.LensControllerAPI.custom_get_sensitivity_mode (   self)

Send Custom Command - Get sensitivity type This function retrieves the sensitivity mode.

Returns
sensitivity mode as an integer:
  • 0: Default
  • 1: Less sensitive (for long Cable)

◆ custom_get_zoom_position()

api.LensControllerAPI.custom_get_zoom_position (   self)

Send Custom Command - Get zoom position This function retrieves the current zoom position of the lens.

Returns
current zoom position as an integer.

◆ custom_set_focus_position()

api.LensControllerAPI.custom_set_focus_position (   self,
  focus_position 
)

Send Custom Command - Set focus position of the lens.

Parameters
[in]focus_positionThe absolute position of the focus lens

◆ custom_set_iris_position()

api.LensControllerAPI.custom_set_iris_position (   self,
  iris_position 
)

Send Custom Command - Set iris position of the lens.

Parameters
[in]iris_positionThe absolute position of the iris lens

◆ custom_set_sensitivity_mode()

api.LensControllerAPI.custom_set_sensitivity_mode (   self,
  mode 
)

Send Custom Command - Set sensitivity of the lens.

Parameters
[in]sensitivitymode as an integer:
  • 0: Default
  • 1: Less sensitive (for long Cable)

◆ custom_set_zoom_position()

api.LensControllerAPI.custom_set_zoom_position (   self,
  zoom_position 
)

Send Custom Command - Set zoom position of the lens.

Parameters
[in]zoom_positionThe absolute position of the zoom lens

◆ custom_store_current_settings()

api.LensControllerAPI.custom_store_current_settings (   self)

Send Custom Command - store current settings in lens controller This function stores all settings in the lens controller.

Settings will be restored after power cycle.

◆ pelco_d_call_preset()

api.LensControllerAPI.pelco_d_call_preset (   self,
  preset 
)

Send Pelco D Command - Call preset.

Parameters
[in]presetThe preset (number [1-10]) to call

◆ pelco_d_set_focus_speed()

api.LensControllerAPI.pelco_d_set_focus_speed (   self,
  speed 
)

Send Pelco D Command - Set focus speed; Set speed for focussing far and near @Note: Call custom_store_current_settings() to store the set speed in the lens controller.

Parameters
[in]speedThe speed value (number [0-2])

◆ pelco_d_set_preset()

api.LensControllerAPI.pelco_d_set_preset (   self,
  preset 
)

Send Pelco D Command - Set preset; Set current positions under preset# @Note: The preset is set, but will be lost after power cycle.

Call custom_store_current_settings() to store the preset in the lens controller.

Parameters
[in]presetThe preset (number [1-10]) to call

◆ pelco_d_set_zoom_speed()

api.LensControllerAPI.pelco_d_set_zoom_speed (   self,
  speed 
)

Send Pelco D Command - Set zoom speed; Set speed for zooming in and out @Note: Call custom_store_current_settings() to store the set speed in the lens controller.

Parameters
[in]speedThe speed value (number [0-2])

◆ send_command()

api.LensControllerAPI.send_command (   self,
  command 
)

Sends a command to the lens controller and reads the response.

Parameters
[in]commandThe command to send.

◆ send_custom_command_and_receive()

api.LensControllerAPI.send_custom_command_and_receive (   self,
  command1,
  data1 = 0x01,
  data2 = 0x02,
  data3 = 0x03,
  data4 = 0x04 
)

Sends a custom command to the lens controller and reads the response.

Parameters
[in]command1The first command to send.
[in]data1The first piece of data to send.
[in]data2The second piece of data to send.
[in]data3The third piece of data to send.
[in]data4The fourth piece of data to send.

The documentation for this class was generated from the following file: